# coding: utf-8
from django.http import HttpResponse
import Image,ImageDraw,ImageFont
import os

def testshow(request):
    filepath=os.path.join('static','img4478586_n.jpg')
    im=Image.open(filepath)
    draw = ImageDraw.Draw(im)
    ttfpath=os.path.join('static','heiti.ttf')
    font=ImageFont.truetype(ttfpath,30)
#    font=ImageFont.load_default()
    draw.text((0,0),'www.guojl.com',font=font,fill=255)
    del draw
    filename=os.path.basename(filepath)
#    filename='d.png'
    # write to stdout
    im.save(os.path.join('static','upload',filename))


    return  HttpResponse('dd')


